package spring6.iocxml.auto.controller;

import spring6.iocxml.auto.service.UserService;
import spring6.iocxml.auto.service.UserServiceImpl;

public class UserController {
    public void addUser(){
        System.out.println("controller方法执行了");
//        原生写法 controller -> service -> dao
//        UserService userService = new UserServiceImpl();
//        userService.addUserService();

        //        Spring写法
        userService.addUserService();

    }

    private UserService userService;

    public void setUserService(UserService userService) {
        this.userService = userService;
    }
}
